<template>
  <div>
    <!-- 顶部栏 -->
    <van-nav-bar
      title="会员新鲜事"
      left-arrow
      fixed
      @click.left.native="$router.go(-1)"
    >
    </van-nav-bar>
    <div class="newImg">
      <div v-for="item in newImg" :key="item.nid">
        <router-link :to="`/nd${item.nid}`">
          <van-image lazy-load :src="newURL + item.image" />
        </router-link>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions, mapState } from "vuex"
export default {
  computed: {
    ...mapState(["newImg", "newURL"]),
  },
  methods: {
    ...mapActions(["getNew"]),
  },
  mounted() {
    this.getNew()
  },
}
</script>

<style lang="scss">
.newImg {
  margin-top: 46px;
  width: 100vw;

  div {
    padding: 0 2vw;
    .van-image__img {
      border-radius: 3vw;
    }
  }
}
</style>
